/*

 * and open the template in the editor.
 */

package hcmus.fit.master.sevensea.control;

import java.io.IOException;

import android.graphics.Canvas;
import android.hardware.Camera.Size;

/**
 * 
 * @author hvp
 */
public class Control {
    // public
    private Size _size;

    // public static Image BackGround;
    public Score _Score;
    public Level _Level;
    public Life _Life;
    private int _bonusLife;

    public static void LoadResources() {
        try {
            // Bitmap img = Bitmap.createImage("/scorenumber.png");
            // Level.Resources = Life.Resources = Score.Resources =
            // Score.GetResource(img, 10, 1, 1, 1);

            // img = Image.createImage("/scorenumber.png");

            // img = Image.createImage("/control.png");
            // BackGround = Image.createImage(img,0,0,img.getWidth(),
            // img.getHeight(),Sprite.TRANS_NONE);

            // img = Image.createImage("/lifeicon.png");
            // Life.Icon = Image.createImage(img,0,0,img.getWidth(),
            // img.getHeight(),Sprite.TRANS_NONE);
            //
            // img = Image.createImage("/sliderthumb.png");
            // Level.Icon = Image.createImage(img,0,0,img.getWidth(),
            // img.getHeight(),Sprite.TRANS_NONE);
        } catch (Exception ex) {
        }
    }

    public Control(Size size) {
        _size = size;

        _Score = new Score(0);
        _Level = new Level(1);
        _Life = new Life(4);
        _bonusLife = 0;
    }

    public void Show(Canvas g) {
        if (_Score.SCORE / 1000 != _bonusLife) {
            _Life.LIFE++;
            _bonusLife++;
        }
        // _Level.Show(g, 50, 8);
        // _Life.Show(g, 225, 8);
        // Image BackGround = Image.createImage("/control.png");
        // Image tmp = Image.createImage(BackGround.getWidth(),
        // BackGround.getHeight());
        // Graphics g1 = tmp.getGraphics();
        // g1.drawImage(BackGround, 0, 0, Graphics.TOP | Graphics.LEFT);
        // _Score.Show(g1, 120, 38);
        // g.drawRegion(tmp, 0, 0, tmp.getWidth(), tmp.getHeight(),
        // Sprite.TRANS_NONE, 0, _size.Height - tmp.getHeight(), Graphics.TOP |
        // Graphics.LEFT);
    }

}
